var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var copyRewardService = require('../../app/services/copyRewardService');
var config = require('../config');
var dataApi = require('../../app/libs/dataApi');
var rewardType = require('../../app/consts/rewardType');

suite('测试copyRewardService', function () {
    suite('getReward', function () {
        test('获取奖励', function () {
            var carbon_all_conf = dataApi.carbon.all();
            // _.each(carbon_all_conf, function (value, key) {
            //     _.size(copyRewardService.getReward(key)).should.equal(1);
            // });
        });
    });
});

var _getReward = function (hero_lvl_all_conf) {
    _.each(hero_lvl_all_conf, function (value, key) {
        var reward_list = battleRewardService.getReward(key, 3);
        _.size(reward_list).should.equal(3);
        _.each(reward_list, function (reward_item) {
            switch (reward_item.prize_type) {
            case rewardType.GOLD:
            case rewardType.DIAMOND:
            case rewardType.PROPERTY:
            case rewardType.GEMSTONE:
                {
                    assert.equal(reward_item.reward > 0, true);
                    break;
                }
            case rewardType.EQUIP:
                {
                    assert.equal(dataApi.equipment_type.findById(reward_item.reward) != null, true);
                    break;
                }
            }
        });
    });
};
